<template>
    <van-action-sheet
            class="common-action-sheet-wrap"
            v-model="visible"
            :actions="actions"
            cancel-text="取消"
            :description="description"
            @select="handleSelectItem"
            close-on-click-action
            @closed="$emit('closed')"
    />
</template>

<script>
    import {ActionSheet} from 'vant';

    export default {
        components: {
            [ActionSheet.name]: ActionSheet
        },

        props: {
            visible: Boolean,

            actions: {
                type: Array,
                required: true
            },

            description: String
        },

        methods: {
            handleSelectItem (item){
                this.$emit('on-select', item);
            }
        }
    }
</script>

<style lang="scss">
    .common-action-sheet-wrap {
    }
</style>